// DBPropertyParser.cpp: implementation of the DBPropertyParser class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "DBPropertyParser.h"

#include "DBVariable.h"
#include "Property.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
namespace pa
{
	UE_IMPLEMENT_DYNPROPERTYCREATE(DBPropertyParser)
	DBPropertyParser::DBPropertyParser()
	{

	}

	DBPropertyParser::~DBPropertyParser()
	{

	}


	bool DBPropertyParser::IsLegeal(const OriginalProperty& OP)
	{
		if( (OP->GetString("PropertyStyle")=="in")
			&&(!OP->GetBool("Customization")) )
		{
			return true;
		}
		else 
		{
			return false;
		}
	}

	Property* DBPropertyParser::NewProperty(const OriginalProperty& OP)
	{
		DBVariable* pVariable = new DBVariable;
    	PropertyParser::CopyPublicData(pVariable,OP);
		
		pVariable->SetPropertyType(Property::eDB);
		pVariable->PropertyTable(OP->GetString(_T("PropertyTableName")));
		pVariable->PropertyField(OP->GetString(_T("PropertyField")));
		return pVariable;
	}
};
